package com.group.library.order.controller.admin;

import com.group.library.order.dto.MessageBean;
import com.group.library.order.service.OrderService;
import com.group.library.order.util.MessageUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/admin/order")
public class OrderManageController {

    @Autowired
    private OrderService orderService;

    @RequestMapping(value = "/listOrder.action",method = RequestMethod.GET)
    public MessageBean listOrder(Integer page, Integer limit, String name, String number){
        try{
            return MessageUtil.success("查找成功！",orderService.findOrder(page, limit, name, number));
        } catch (Exception e){
            e.printStackTrace();
            return MessageUtil.failure("查找失败！");
        }
    }

}
